package com.sskj.wallet.presenter;

import com.lzy.okgo.model.Response;
import com.sskj.common.base.HttpData;
import com.sskj.lib.http.JsonCallBack;
import com.sskj.wallet.bean.AwardBean;
import com.sskj.wallet.http.HttpConfig;
import com.sskj.wallet.ui.activity.CoinInfoActivity;


public class CoinInfoActivityPresenter extends BasePresenter<CoinInfoActivity> {

    public void checkAward(String addr,String type) {
        httpService.checkAward(addr,type)
                .execute(new JsonCallBack<HttpData<AwardBean>>() {
                    @Override
                    public void onSuccess(Response<HttpData<AwardBean>> response) {
                        HttpData<AwardBean> httpData = response.body();
                        if (httpData.getStatus() == HttpConfig.OK) {
                            mView.updateAward(httpData.getData());
                        }
                    }
                });
    }
}
